﻿
namespace Stimulus360.Models.Common
{
    /// <summary>
    ///     Class represents a rule voilation to be shown on the screen
    /// </summary>
    public class RuleViolation
    {
        /// <summary>
        ///     The error message to be shown
        /// </summary>
        public string ErrorMessage { get; private set; }

        /// <summary>
        ///     The property that has been voilated
        /// </summary>
        public string PropertyName { get; private set; }

        /// <summary>
        ///     Constructor. Takes in the error message to be shown
        /// </summary>
        /// <param name="errorMessage">
        ///     The error message to be shown
        /// </param>
        public RuleViolation(string errorMessage)
        {
            ErrorMessage = errorMessage;
        }

        /// <summary>
        ///     Overloaded constructor. Takes in the error message to be shown
        ///     and the property voilated
        /// </summary>
        /// <param name="errorMessage">
        ///     The error message to be shown
        /// </param>
        /// <param name="propertyName">
        ///     The property voilated.
        /// </param>
        public RuleViolation(string errorMessage, string propertyName)
        {
            ErrorMessage = errorMessage;
            PropertyName = propertyName;
        }
    }
}
